import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import RegisterView from '../views/RegisterView.vue'

const routes = [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/movie/:id',
      name: 'movieDetail',
      component: () => import('../views/MovieDetail.vue'),
    },
    {
      path: '/movie-list',
      name: 'movie-list',
      component: () => import('../views/HomeView.vue'),
    },
    {
      path:'/register',
      name:'register',
      component:RegisterView,
      meta:{
        requiresAuth:false
      }
    },
    {
      path:'/activate/:udi/:token',
      name:'activate',
      component:()=>import('../views/ActivateView.vue'),
      meta:{
        requiresAuth:false
      }
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue'),
    },
    {
      path: '/reset-password',
      name: 'reset-password',
      component: () => import('../views/ChangePassword.vue'),
    },
    {
      path: '/member_cards',
      name: 'member_cards',
      component: () => import('../views/Cards.vue'),
    },

]
const router = createRouter({
  history: createWebHistory(import.meta.env.VUE_APP_BASE_URL),
  routes
})


export default router
